<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>hwicap: xhwicap_low_level_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">hwicap
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xhwicap__low__level__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xhwicap_low_level_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Contains a design example of how to use the low-level macros and functions of the <a class="el" href="struct_x_hw_icap.html" title="The XHwIcap driver instance data. ">XHwIcap</a> driver. </p>
<p>This example reads back the value stored in the IDCODE register.</p>
<p>This example assumes that there is a UART Device or STDIO Device in the hardware system.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This example can be run on a 7 series device, Zynq device, Ultrascale and ZynqMP Ultrascale FPGAs.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a bjb  11/21/03 First release
1.00a sv   07/18/05 Minor changes to comply to Doxygen and coding guidelines
1.01a sv   04/10/07 Changes to support V4
2.00a sv   10/10/07 Changes to support V5
4.00a hvm  11/20/09 Added support for V6 and updated with HAL phase 1
              modifications
5.00a hvm  02/08/10 Added support for S6
5.00a hvm  04/28/10 Added Check for the control bit clearance in the CR
                register for regsiter read and write operations.
5.00a hvm  05/04/10 Updated the example to read Id twice so as to igonore
                the first read.
5.00a hvm  05/21/10 Updated the ID sequence to be consistent across V4/V5/V6
                devices. Added an extra NOP before Type1 Read device ID
                and removed  extra NOP after the device ID. This
                change removed the need of reading ID twice.
                Removed the extra read ID.
5.01a hvm  07/29/10 Code to check whether read/write bit in control register
                is cleared after the initiation of respective transfer
                is added for all devices. This check was earlier done
                only for S6 devices
6.00a hvm  08/05/11 Added support for K7 family
10.0  bss  6/24/14  Removed support for families older than 7 series
11.0  ms   01/23/17 Added xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings
                    are available in all examples. This is a fix for
                    CR-965028.
11.6 Nava 06/28/23  Added support for system device-tree flow.
11.7 Nava 02/06/25  Updated HWICAP_BASEADDR to use XPAR_HWICAP_0_BASEADDR
                    instead of XPAR_XHWICAP_0_BASEADDR to align with YAML
                    changes.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8a02099406a7fcf25a097b2f45611263"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhwicap__low__level__example_8c.html#a8a02099406a7fcf25a097b2f45611263">HwIcapLowLevelExample</a> (u32 BaseAddress, u32 *IdCode)</td></tr>
<tr class="memdesc:a8a02099406a7fcf25a097b2f45611263"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the IDCODE of the target device.  <a href="#a8a02099406a7fcf25a097b2f45611263">More...</a><br/></td></tr>
<tr class="separator:a8a02099406a7fcf25a097b2f45611263"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhwicap__low__level__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the HWICAP Low Level example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a8a02099406a7fcf25a097b2f45611263"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 HwIcapLowLevelExample </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BaseAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>IdCode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the IDCODE of the target device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>is the base address of the HwIcap instance. </td></tr>
    <tr><td class="paramname">IdCode</td><td>is the IDCODE of the part this code is running on.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="group__hwicap.html#gad7d94ec59e14347684d309b0b6406ab2">XHI_CR_OFFSET</a>, <a class="el" href="group__hwicap.html#ga5f79a1af0d4909378342da1723568653">XHI_CR_READ_MASK</a>, <a class="el" href="group__hwicap.html#gaef1da3487a4b5b56304445dd5892855b">XHI_CR_WRITE_MASK</a>, <a class="el" href="group__hwicap.html#ga880c301214287dc0231e142662bba24c">XHI_RF_OFFSET</a>, <a class="el" href="group__hwicap.html#ga5f6dfed1a6cda2d244f7b58ccf734eb3">XHI_SR_DONE_MASK</a>, <a class="el" href="group__hwicap.html#gad582c2c3fe5aa1d83b43dc7a0d243da8">XHI_SR_OFFSET</a>, <a class="el" href="group__hwicap.html#ga61e8525d9e209cad45122af264f276f0">XHI_SZ_OFFSET</a>, <a class="el" href="group__hwicap.html#ga9f823f835a5a4cc52bb93dd31f88c62c">XHI_WF_OFFSET</a>, <a class="el" href="group__hwicap.html#ga7061e53605486f268a5e2205828d5921">XHwIcap_ReadReg</a>, and <a class="el" href="group__hwicap.html#ga8abfb8a13021622966d96781cb1a0f86">XHwIcap_WriteReg</a>.</p>

<p>Referenced by <a class="el" href="xhwicap__low__level__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the HWICAP Low Level example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xhwicap__low__level__example_8c.html#a8a02099406a7fcf25a097b2f45611263">HwIcapLowLevelExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
